package com.jhs.kjs.dto;

import java.util.Date;

import com.jhs.kjs.dto.util.abstractDTO;
import com.jhs.kjs.model.daumMap.frame.ExtDirection;
import com.jhs.kjs.model.daumMap.frame.ILatLng;

public class CarSensorDTO extends abstractDTO implements ILatLng, Comparable<CarSensorDTO>{
	private Long carSensorCode;
	private Long CarCode;
	private Date DetectTime;
	private Integer DTGState;
	private Long Speed;
	private Long DayDistance;
	private Long TotalDistance;
	private String CDMAState;
	private String GPSState;
	private Long Temperature;
	private Long Humidity;
	private Long Voltage;


	private Double Lat;
	private Double Lng;
	private int Direction;
	private String Address;
	private String AddressComponent1;
	private String AddressComponent2;
	private String AddressComponent3;

	private String StartUp;
	
	private int seq;
	
	private Long rpm;

	private Integer breaked;
	
	private Long epochtime;
	
	private Long checkAreaCode;
	private String run;
	
	
	public Long getCarSensorCode() {
		return carSensorCode;
	}

	public void setCarSensorCode(Long carSensorCode) {
		this.carSensorCode = carSensorCode;
	}

	public Long getCarCode() {
		return CarCode;
	}

	public void setCarCode(Long carCode) {
		CarCode = carCode;
	}

	public Date getDetectTime() {
		return DetectTime;
	}

	public void setDetectTime(Date detectTime) {
		DetectTime = detectTime;
	}

	public Integer getDTGState() {
		return DTGState;
	}

	public void setDTGState(Integer dTGState) {
		DTGState = dTGState;
	}

	public Long getSpeed() {
		return Speed;
	}

	public void setSpeed(Long speed) {
		Speed = speed;
	}

	public Long getDayDistance() {
		return DayDistance;
	}

	public void setDayDistance(Long dayDistance) {
		DayDistance = dayDistance;
	}

	public Long getTotalDistance() {
		return TotalDistance;
	}

	public void setTotalDistance(Long totalDistance) {
		TotalDistance = totalDistance;
	}

	public String getCDMAState() {
		return CDMAState;
	}

	public void setCDMAState(String cDMAState) {
		CDMAState = cDMAState;
	}

	public String getGPSState() {
		return GPSState;
	}

	public void setGPSState(String gPSState) {
		GPSState = gPSState;
	}

	public Long getTemperature() {
		return Temperature;
	}

	public void setTemperature(Long temperature) {
		Temperature = temperature;
	}

	public Long getHumidity() {
		return Humidity;
	}

	public void setHumidity(Long humidity) {
		Humidity = humidity;
	}

	public Long getVoltage() {
		return Voltage;
	}

	public void setVoltage(Long voltage) {
		Voltage = voltage;
	}

	public Double getLat() {
		return Lat;
	}

	public void setLat(Double lat) {
		Lat = lat;
	}

	public Double getLng() {
		return Lng;
	}

	public void setLng(Double lng) {
		Lng = lng;
	}

	public int getDirection() {
		return Direction;
	}

	public void setDirection(int direction) {
		Direction = direction;
	}

	public String getAddress() {
		return Address;
	}

	public void setAddress(String address) {
		Address = address;
	}

	public String getAddressComponent1() {
		return AddressComponent1;
	}

	public void setAddressComponent1(String addressComponent1) {
		AddressComponent1 = addressComponent1;
	}

	public String getAddressComponent2() {
		return AddressComponent2;
	}

	public void setAddressComponent2(String addressComponent2) {
		AddressComponent2 = addressComponent2;
	}

	public String getAddressComponent3() {
		return AddressComponent3;
	}

	public void setAddressComponent3(String addressComponent3) {
		AddressComponent3 = addressComponent3;
	}

	@Override
	public int getCardinal() {
		// TODO Auto-generated method stub
		return ExtDirection.getCardinal(getDirection());
	}

	public String getCardinalStr() {
		// TODO Auto-generated method stub
		return ExtDirection.getCardinalString(ExtDirection.getCardinal(getDirection()));
	}
	
	public String getStartUp() {
		return StartUp;
	}

	public void setStartUp(String startUp) {
		StartUp = startUp;
	}

	public int getSeq() {
		return seq;
	}

	public void setSeq(int seq) {
		this.seq = seq;
	}

	public Long getRpm() {
		return rpm;
	}

	public void setRpm(Long rpm) {
		this.rpm = rpm;
	}

	public Integer getBreaked() {
		return breaked;
	}

	public void setBreaked(Integer breaked) {
		this.breaked = breaked;
	}

	public Long getEpochtime() {
		return epochtime;
	}

	public void setEpochtime(Long epochtime) {
		this.epochtime = epochtime;
	}

	
	public Long getCheckAreaCode() {
		return checkAreaCode;
	}

	public void setCheckAreaCode(Long checkAreaCode) {
		this.checkAreaCode = checkAreaCode;
	}

	public String getRun() {
		return run;
	}

	public void setRun(String run) {
		this.run = run;
	}

	@Override
	public int compareTo(CarSensorDTO o) {
		if(this.getEpochtime()==null) this.setEpochtime(0L);
		if(o.getEpochtime() == null) o.setEpochtime(0L);
		
		return (int) (this.getEpochtime()-o.getEpochtime());
	}

	
}
